#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	cin>>s;
	int len = s.size();
	int cnt = 0;
	for(int i = 1;i <= len;i++)
	{
		if(s[i] == s[i-1])
			cnt++;
		else
		{
			cout<<cnt+1<<s[i-1];
			cnt = 0;
		}
	}
    return 0;
}

